-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Suspend Broken Tenants & Delete Broken Clients #177
Conversation
No linked issues found. Please add the corresponding issues in the pull request description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than tests are missing here as well.
Would be good to cover in functional tests
src/handlers/push_message.rs
Outdated
Ok(_) => Ok(()), | ||
Err(error) => match error { | ||
Error::BadDeviceToken => { | ||
state.client_store.delete_client(&tenant_id, &id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a soft delete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No its a hard delete as the data we have stored is now useless, we still have data about the client in datalake
@@ -435,4 +452,8 @@ impl TenantStore for DefaultTenantStore { | |||
) -> Result<Tenant> { | |||
panic!("Shouldn't have run in single tenant mode") | |||
} | |||
|
|||
async fn suspend_tenant(&self, id: &str, reason: &str) -> Result<()> { | |||
panic!("Shouldn't have run in single tenant mode") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error message could be improved:
panic!("Shouldn't have run in single tenant mode") | |
panic!("Invalid APNS or FCM credentials. Cannot suspend tenant in single-tenant mode, so panicking instead.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There error message is the same for all the functions, they cannot be run in single-tenant mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the other functions' error messages could be improved too?
I just don't see any debugging info that would help a service maintainer know that their credential had expired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdym? The panics here are for function calls that won't/can't be done in single-tenant mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, if they are impossible to call, then you should use unreachable!()
instead of panic!()
Description
Saves IP reputation and removes random 5XX errors
How Has This Been Tested?
N/a
Due Diligence